﻿using System;
using System.ComponentModel;

namespace HalconDotNet
{
	/// <summary>Represents an instance of an XLD polygon object(-array).</summary>
	// Token: 0x02000078 RID: 120
	[Serializable]
	public class HXLDPoly : HXLD
	{
		/// <summary>Create an uninitialized iconic object</summary>
		// Token: 0x06001CE3 RID: 7395 RVA: 0x000ABEF9 File Offset: 0x000AA0F9
		public HXLDPoly() : base(HObjectBase.UNDEF, false)
		{
		}

		// Token: 0x06001CE4 RID: 7396 RVA: 0x000B2B9A File Offset: 0x000B0D9A
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HXLDPoly(IntPtr key) : this(key, true)
		{
			this.AssertObjectClass();
			GC.KeepAlive(this);
		}

		// Token: 0x06001CE5 RID: 7397 RVA: 0x000B2BB0 File Offset: 0x000B0DB0
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HXLDPoly(IntPtr key, bool copy) : base(key, copy)
		{
			this.AssertObjectClass();
			GC.KeepAlive(this);
		}

		// Token: 0x06001CE6 RID: 7398 RVA: 0x000B2BC6 File Offset: 0x000B0DC6
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HXLDPoly(HObject obj) : base(obj)
		{
			this.AssertObjectClass();
			GC.KeepAlive(this);
		}

		// Token: 0x06001CE7 RID: 7399 RVA: 0x000B2BDB File Offset: 0x000B0DDB
		private void AssertObjectClass()
		{
			HalconAPI.AssertObjectClass(this.key, "xld_poly");
		}

		/// <summary>Returns the iconic object(s) at the specified index</summary>
		// Token: 0x1700006A RID: 106
		public HXLDPoly this[HTuple index]
		{
			get
			{
				return this.SelectObj(index);
			}
		}

		// Token: 0x06001CE9 RID: 7401 RVA: 0x000B2BF6 File Offset: 0x000B0DF6
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static int LoadNew(IntPtr proc, int parIndex, int err, out HXLDPoly obj)
		{
			obj = new HXLDPoly(HObjectBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		/// <summary>
		///   Compute the union of closed polygons.
		///   Instance represents: Polygons enclosing the first region.
		/// </summary>
		/// <param name="polygons2">Polygons enclosing the second region.</param>
		/// <returns>Polygons enclosing the union.</returns>
		// Token: 0x06001CEA RID: 7402 RVA: 0x000B2C10 File Offset: 0x000B0E10
		public HXLDPoly Union2ClosedPolygonsXld(HXLDPoly polygons2)
		{
			IntPtr proc = HalconAPI.PreCall(5);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, polygons2);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(polygons2);
			return result;
		}

		/// <summary>
		///   Compute the symmetric difference of closed polygons.
		///   Instance represents: Polygons enclosing the first region.
		/// </summary>
		/// <param name="polygons2">Polygons enclosing the second region.</param>
		/// <returns>Polygons enclosing the symmetric difference.</returns>
		// Token: 0x06001CEB RID: 7403 RVA: 0x000B2C64 File Offset: 0x000B0E64
		public HXLDPoly SymmDifferenceClosedPolygonsXld(HXLDPoly polygons2)
		{
			IntPtr proc = HalconAPI.PreCall(7);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, polygons2);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(polygons2);
			return result;
		}

		/// <summary>
		///   Compute the difference of closed polygons.
		///   Instance represents: Polygons enclosing the region from which the second region is subtracted.
		/// </summary>
		/// <param name="sub">Polygons enclosing the region that is subtracted from the first region.</param>
		/// <returns>Polygons enclosing the difference.</returns>
		// Token: 0x06001CEC RID: 7404 RVA: 0x000B2CB8 File Offset: 0x000B0EB8
		public HXLDPoly DifferenceClosedPolygonsXld(HXLDPoly sub)
		{
			IntPtr proc = HalconAPI.PreCall(9);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, sub);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(sub);
			return result;
		}

		/// <summary>
		///   Intersect closed polygons.
		///   Instance represents: Polygons enclosing the first region to be intersected.
		/// </summary>
		/// <param name="polygons2">Polygons enclosing the second region to be intersected.</param>
		/// <returns>Polygons enclosing the intersection.</returns>
		// Token: 0x06001CED RID: 7405 RVA: 0x000B2D0C File Offset: 0x000B0F0C
		public HXLDPoly IntersectionClosedPolygonsXld(HXLDPoly polygons2)
		{
			IntPtr proc = HalconAPI.PreCall(11);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, polygons2);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(polygons2);
			return result;
		}

		/// <summary>
		///   Read XLD polygons from a file in ARC/INFO generate format.
		///   Modified instance represents: Read XLD polygons.
		/// </summary>
		/// <param name="fileName">Name of the ARC/INFO file.</param>
		// Token: 0x06001CEE RID: 7406 RVA: 0x000B2D60 File Offset: 0x000B0F60
		public void ReadPolygonXldArcInfo(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(18);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 1, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Write XLD polygons to a file in ARC/INFO generate format.
		///   Instance represents: XLD polygons to be written.
		/// </summary>
		/// <param name="fileName">Name of the ARC/INFO file.</param>
		// Token: 0x06001CEF RID: 7407 RVA: 0x000B2DAC File Offset: 0x000B0FAC
		public void WritePolygonXldArcInfo(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(19);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Combine road hypotheses from two resolution levels.
		///   Instance represents: XLD polygons to be examined.
		/// </summary>
		/// <param name="modParallels">Modified parallels obtained from EdgePolygons.</param>
		/// <param name="extParallels">Extended parallels obtained from EdgePolygons.</param>
		/// <param name="centerLines">Road-center-line polygons to be examined.</param>
		/// <param name="maxAngleParallel">Maximum angle between two parallel line segments. Default: 0.523598775598</param>
		/// <param name="maxAngleColinear">Maximum angle between two collinear line segments. Default: 0.261799387799</param>
		/// <param name="maxDistanceParallel">Maximum distance between two parallel line segments. Default: 40</param>
		/// <param name="maxDistanceColinear">Maximum distance between two collinear line segments. Default: 40</param>
		/// <returns>Roadsides found.</returns>
		// Token: 0x06001CF0 RID: 7408 RVA: 0x000B2DE8 File Offset: 0x000B0FE8
		public HXLDPoly CombineRoadsXld(HXLDModPara modParallels, HXLDExtPara extParallels, HXLDPoly centerLines, HTuple maxAngleParallel, HTuple maxAngleColinear, HTuple maxDistanceParallel, HTuple maxDistanceColinear)
		{
			IntPtr proc = HalconAPI.PreCall(37);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, modParallels);
			HalconAPI.Store(proc, 3, extParallels);
			HalconAPI.Store(proc, 4, centerLines);
			HalconAPI.Store(proc, 0, maxAngleParallel);
			HalconAPI.Store(proc, 1, maxAngleColinear);
			HalconAPI.Store(proc, 2, maxDistanceParallel);
			HalconAPI.Store(proc, 3, maxDistanceColinear);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(maxAngleParallel);
			HalconAPI.UnpinTuple(maxAngleColinear);
			HalconAPI.UnpinTuple(maxDistanceParallel);
			HalconAPI.UnpinTuple(maxDistanceColinear);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(modParallels);
			GC.KeepAlive(extParallels);
			GC.KeepAlive(centerLines);
			return result;
		}

		/// <summary>
		///   Combine road hypotheses from two resolution levels.
		///   Instance represents: XLD polygons to be examined.
		/// </summary>
		/// <param name="modParallels">Modified parallels obtained from EdgePolygons.</param>
		/// <param name="extParallels">Extended parallels obtained from EdgePolygons.</param>
		/// <param name="centerLines">Road-center-line polygons to be examined.</param>
		/// <param name="maxAngleParallel">Maximum angle between two parallel line segments. Default: 0.523598775598</param>
		/// <param name="maxAngleColinear">Maximum angle between two collinear line segments. Default: 0.261799387799</param>
		/// <param name="maxDistanceParallel">Maximum distance between two parallel line segments. Default: 40</param>
		/// <param name="maxDistanceColinear">Maximum distance between two collinear line segments. Default: 40</param>
		/// <returns>Roadsides found.</returns>
		// Token: 0x06001CF1 RID: 7409 RVA: 0x000B2E98 File Offset: 0x000B1098
		public HXLDPoly CombineRoadsXld(HXLDModPara modParallels, HXLDExtPara extParallels, HXLDPoly centerLines, double maxAngleParallel, double maxAngleColinear, double maxDistanceParallel, double maxDistanceColinear)
		{
			IntPtr proc = HalconAPI.PreCall(37);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, modParallels);
			HalconAPI.Store(proc, 3, extParallels);
			HalconAPI.Store(proc, 4, centerLines);
			HalconAPI.StoreD(proc, 0, maxAngleParallel);
			HalconAPI.StoreD(proc, 1, maxAngleColinear);
			HalconAPI.StoreD(proc, 2, maxDistanceParallel);
			HalconAPI.StoreD(proc, 3, maxDistanceColinear);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(modParallels);
			GC.KeepAlive(extParallels);
			GC.KeepAlive(centerLines);
			return result;
		}

		/// <summary>
		///   Extract parallel XLD polygons.
		///   Instance represents: Input polygons.
		/// </summary>
		/// <param name="len">Minimum length of the individual polygon segments. Default: 10.0</param>
		/// <param name="dist">Maximum distance between the polygon segments. Default: 30.0</param>
		/// <param name="alpha">Maximum angle difference of the polygon segments. Default: 0.15</param>
		/// <param name="merge">Should adjacent parallel relations be merged? Default: "true"</param>
		/// <returns>Parallel polygons.</returns>
		// Token: 0x06001CF2 RID: 7410 RVA: 0x000B2F2C File Offset: 0x000B112C
		public HXLDPara GenParallelsXld(HTuple len, HTuple dist, HTuple alpha, string merge)
		{
			IntPtr proc = HalconAPI.PreCall(42);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, len);
			HalconAPI.Store(proc, 1, dist);
			HalconAPI.Store(proc, 2, alpha);
			HalconAPI.StoreS(proc, 3, merge);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(len);
			HalconAPI.UnpinTuple(dist);
			HalconAPI.UnpinTuple(alpha);
			HXLDPara result;
			num = HXLDPara.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Extract parallel XLD polygons.
		///   Instance represents: Input polygons.
		/// </summary>
		/// <param name="len">Minimum length of the individual polygon segments. Default: 10.0</param>
		/// <param name="dist">Maximum distance between the polygon segments. Default: 30.0</param>
		/// <param name="alpha">Maximum angle difference of the polygon segments. Default: 0.15</param>
		/// <param name="merge">Should adjacent parallel relations be merged? Default: "true"</param>
		/// <returns>Parallel polygons.</returns>
		// Token: 0x06001CF3 RID: 7411 RVA: 0x000B2FA4 File Offset: 0x000B11A4
		public HXLDPara GenParallelsXld(double len, double dist, double alpha, string merge)
		{
			IntPtr proc = HalconAPI.PreCall(42);
			base.Store(proc, 1);
			HalconAPI.StoreD(proc, 0, len);
			HalconAPI.StoreD(proc, 1, dist);
			HalconAPI.StoreD(proc, 2, alpha);
			HalconAPI.StoreS(proc, 3, merge);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPara result;
			num = HXLDPara.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Return an XLD polygon's data (as lines).
		///   Instance represents: Input XLD polygons.
		/// </summary>
		/// <param name="beginRow">Row coordinates of the lines' start points.</param>
		/// <param name="beginCol">Column coordinates of the lines' start points.</param>
		/// <param name="endRow">Column coordinates of the lines' end points.</param>
		/// <param name="endCol">Column coordinates of the lines' end points.</param>
		/// <param name="length">Lengths of the line segments.</param>
		/// <param name="phi">Angles of the line segments.</param>
		// Token: 0x06001CF4 RID: 7412 RVA: 0x000B300C File Offset: 0x000B120C
		public void GetLinesXld(out HTuple beginRow, out HTuple beginCol, out HTuple endRow, out HTuple endCol, out HTuple length, out HTuple phi)
		{
			IntPtr proc = HalconAPI.PreCall(43);
			base.Store(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			HalconAPI.InitOCT(proc, 5);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out beginRow);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out beginCol);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out endRow);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out endCol);
			num = HTuple.LoadNew(proc, 4, HTupleType.DOUBLE, num, out length);
			num = HTuple.LoadNew(proc, 5, HTupleType.DOUBLE, num, out phi);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Return an XLD polygon's data.
		///   Instance represents: Input XLD polygon.
		/// </summary>
		/// <param name="row">Row coordinates of the polygons' points.</param>
		/// <param name="col">Column coordinates of the polygons' points.</param>
		/// <param name="length">Lengths of the line segments.</param>
		/// <param name="phi">Angles of the line segments.</param>
		// Token: 0x06001CF5 RID: 7413 RVA: 0x000B30B4 File Offset: 0x000B12B4
		public void GetPolygonXld(out HTuple row, out HTuple col, out HTuple length, out HTuple phi)
		{
			IntPtr proc = HalconAPI.PreCall(44);
			base.Store(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out row);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out col);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out length);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out phi);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Split XLD contours at dominant points.
		///   Instance represents: Polygons for which the corresponding contours are to be split.
		/// </summary>
		/// <param name="mode">Mode for the splitting of the contours. Default: "polygon"</param>
		/// <param name="weight">Weight for the sensitiveness. Default: 1</param>
		/// <param name="smooth">Width of the smoothing mask. Default: 5</param>
		/// <returns>Split contours.</returns>
		// Token: 0x06001CF6 RID: 7414 RVA: 0x000B3134 File Offset: 0x000B1334
		public HXLDCont SplitContoursXld(string mode, int weight, int smooth)
		{
			IntPtr proc = HalconAPI.PreCall(46);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, mode);
			HalconAPI.StoreI(proc, 1, weight);
			HalconAPI.StoreI(proc, 2, smooth);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDCont result;
			num = HXLDCont.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Apply an arbitrary affine transformation to XLD polygons.
		///   Instance represents: Input XLD polygons.
		/// </summary>
		/// <param name="homMat2D">Input transformation matrix.</param>
		/// <returns>Transformed XLD polygons.</returns>
		// Token: 0x06001CF7 RID: 7415 RVA: 0x000B3194 File Offset: 0x000B1394
		public HXLDPoly AffineTransPolygonXld(HHomMat2D homMat2D)
		{
			IntPtr proc = HalconAPI.PreCall(48);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, homMat2D);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(homMat2D);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Calculate the difference of two object tuples.
		///   Instance represents: Object tuple 1.
		/// </summary>
		/// <param name="objectsSub">Object tuple 2.</param>
		/// <returns>Objects from Objects that are not part of ObjectsSub.</returns>
		// Token: 0x06001CF8 RID: 7416 RVA: 0x000B31F4 File Offset: 0x000B13F4
		public HXLDPoly ObjDiff(HXLDPoly objectsSub)
		{
			IntPtr proc = HalconAPI.PreCall(573);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsSub);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsSub);
			return result;
		}

		/// <summary>
		///   Copy an iconic object in the HALCON database.
		///   Instance represents: Objects to be copied.
		/// </summary>
		/// <param name="index">Starting index of the objects to be copied. Default: 1</param>
		/// <param name="numObj">Number of objects to be copied or -1. Default: 1</param>
		/// <returns>Copied objects.</returns>
		// Token: 0x06001CF9 RID: 7417 RVA: 0x000B324C File Offset: 0x000B144C
		public new HXLDPoly CopyObj(int index, int numObj)
		{
			IntPtr proc = HalconAPI.PreCall(583);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.StoreI(proc, 1, numObj);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Concatenate two iconic object tuples.
		///   Instance represents: Object tuple 1.
		/// </summary>
		/// <param name="objects2">Object tuple 2.</param>
		/// <returns>Concatenated objects.</returns>
		// Token: 0x06001CFA RID: 7418 RVA: 0x000B32A4 File Offset: 0x000B14A4
		public HXLDPoly ConcatObj(HXLDPoly objects2)
		{
			IntPtr proc = HalconAPI.PreCall(584);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Select objects from an object tuple.
		///   Instance represents: Input objects.
		/// </summary>
		/// <param name="index">Indices of the objects to be selected. Default: 1</param>
		/// <returns>Selected objects.</returns>
		// Token: 0x06001CFB RID: 7419 RVA: 0x000B32FC File Offset: 0x000B14FC
		public new HXLDPoly SelectObj(HTuple index)
		{
			IntPtr proc = HalconAPI.PreCall(587);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(index);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Select objects from an object tuple.
		///   Instance represents: Input objects.
		/// </summary>
		/// <param name="index">Indices of the objects to be selected. Default: 1</param>
		/// <returns>Selected objects.</returns>
		// Token: 0x06001CFC RID: 7420 RVA: 0x000B3354 File Offset: 0x000B1554
		public new HXLDPoly SelectObj(int index)
		{
			IntPtr proc = HalconAPI.PreCall(587);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Compare iconic objects regarding equality.
		///   Instance represents: Reference objects.
		/// </summary>
		/// <param name="objects2">Test objects.</param>
		/// <param name="epsilon">Maximum allowed difference between two gray values or  coordinates etc. Default: 0.0</param>
		/// <returns>Boolean result value.</returns>
		// Token: 0x06001CFD RID: 7421 RVA: 0x000B33A4 File Offset: 0x000B15A4
		public int CompareObj(HXLDPoly objects2, HTuple epsilon)
		{
			IntPtr proc = HalconAPI.PreCall(588);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.Store(proc, 0, epsilon);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(epsilon);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Compare iconic objects regarding equality.
		///   Instance represents: Reference objects.
		/// </summary>
		/// <param name="objects2">Test objects.</param>
		/// <param name="epsilon">Maximum allowed difference between two gray values or  coordinates etc. Default: 0.0</param>
		/// <returns>Boolean result value.</returns>
		// Token: 0x06001CFE RID: 7422 RVA: 0x000B3408 File Offset: 0x000B1608
		public int CompareObj(HXLDPoly objects2, double epsilon)
		{
			IntPtr proc = HalconAPI.PreCall(588);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.StoreD(proc, 0, epsilon);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Compare image objects regarding equality.
		///   Instance represents: Test objects.
		/// </summary>
		/// <param name="objects2">Comparative objects.</param>
		/// <returns>boolean result value.</returns>
		// Token: 0x06001CFF RID: 7423 RVA: 0x000B3468 File Offset: 0x000B1668
		public int TestEqualObj(HXLDPoly objects2)
		{
			IntPtr proc = HalconAPI.PreCall(591);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objects2);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			int result;
			num = HalconAPI.LoadI(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objects2);
			return result;
		}

		/// <summary>
		///   Create a region from an XLD polygon.
		///   Instance represents: Input polygon(s).
		/// </summary>
		/// <param name="mode">Fill mode of the region(s). Default: "filled"</param>
		/// <returns>Created region(s).</returns>
		// Token: 0x06001D00 RID: 7424 RVA: 0x000B34C0 File Offset: 0x000B16C0
		public HRegion GenRegionPolygonXld(string mode)
		{
			IntPtr proc = HalconAPI.PreCall(596);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, mode);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HRegion result;
			num = HRegion.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.
		///   Instance represents: Input contours.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="meshes">Output contours.</param>
		/// <param name="gridSpacing">Distance of the grid points in the rectified image.</param>
		/// <param name="rotation">Rotation to be applied to the point grid. Default: "auto"</param>
		/// <param name="row">Row coordinates of the grid points.</param>
		/// <param name="column">Column coordinates of the grid points.</param>
		/// <param name="mapType">Type of mapping. Default: "bilinear"</param>
		/// <returns>Image containing the mapping data.</returns>
		// Token: 0x06001D01 RID: 7425 RVA: 0x000B3510 File Offset: 0x000B1710
		public HImage GenGridRectificationMap(HImage image, out HXLDPoly meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)
		{
			IntPtr proc = HalconAPI.PreCall(1159);
			base.Store(proc, 2);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreI(proc, 0, gridSpacing);
			HalconAPI.Store(proc, 1, rotation);
			HalconAPI.Store(proc, 2, row);
			HalconAPI.Store(proc, 3, column);
			HalconAPI.StoreS(proc, 4, mapType);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(rotation);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HImage result;
			num = HImage.LoadNew(proc, 1, num, out result);
			num = HXLDPoly.LoadNew(proc, 2, num, out meshes);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.
		///   Instance represents: Input contours.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="meshes">Output contours.</param>
		/// <param name="gridSpacing">Distance of the grid points in the rectified image.</param>
		/// <param name="rotation">Rotation to be applied to the point grid. Default: "auto"</param>
		/// <param name="row">Row coordinates of the grid points.</param>
		/// <param name="column">Column coordinates of the grid points.</param>
		/// <param name="mapType">Type of mapping. Default: "bilinear"</param>
		/// <returns>Image containing the mapping data.</returns>
		// Token: 0x06001D02 RID: 7426 RVA: 0x000B35BC File Offset: 0x000B17BC
		public HImage GenGridRectificationMap(HImage image, out HXLDPoly meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)
		{
			IntPtr proc = HalconAPI.PreCall(1159);
			base.Store(proc, 2);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreI(proc, 0, gridSpacing);
			HalconAPI.StoreS(proc, 1, rotation);
			HalconAPI.Store(proc, 2, row);
			HalconAPI.Store(proc, 3, column);
			HalconAPI.StoreS(proc, 4, mapType);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HImage result;
			num = HImage.LoadNew(proc, 1, num, out result);
			num = HXLDPoly.LoadNew(proc, 2, num, out meshes);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Read XLD polygons from a DXF file.
		///   Modified instance represents: Read XLD polygons.
		/// </summary>
		/// <param name="fileName">Name of the DXF file.</param>
		/// <param name="genParamName">Names of the generic parameters that can be adjusted for the DXF input. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters that can be adjusted for the DXF input. Default: []</param>
		/// <returns>Status information.</returns>
		// Token: 0x06001D03 RID: 7427 RVA: 0x000B3660 File Offset: 0x000B1860
		public HTuple ReadPolygonXldDxf(string fileName, HTuple genParamName, HTuple genParamValue)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1634);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.Store(proc, 1, genParamName);
			HalconAPI.Store(proc, 2, genParamValue);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 1, num);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Read XLD polygons from a DXF file.
		///   Modified instance represents: Read XLD polygons.
		/// </summary>
		/// <param name="fileName">Name of the DXF file.</param>
		/// <param name="genParamName">Names of the generic parameters that can be adjusted for the DXF input. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters that can be adjusted for the DXF input. Default: []</param>
		/// <returns>Status information.</returns>
		// Token: 0x06001D04 RID: 7428 RVA: 0x000B36DC File Offset: 0x000B18DC
		public string ReadPolygonXldDxf(string fileName, string genParamName, double genParamValue)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1634);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.StoreS(proc, 1, genParamName);
			HalconAPI.StoreD(proc, 2, genParamValue);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 1, num);
			string result;
			num = HalconAPI.LoadS(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Write XLD polygons to a file in DXF format.
		///   Instance represents: XLD polygons to be written.
		/// </summary>
		/// <param name="fileName">Name of the DXF file.</param>
		// Token: 0x06001D05 RID: 7429 RVA: 0x000B374C File Offset: 0x000B194C
		public void WritePolygonXldDxf(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(1635);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Choose all contours or polygons containing a given point.
		///   Instance represents: Contours or polygons to be examined.
		/// </summary>
		/// <param name="row">Line coordinate of the test point. Default: 100.0</param>
		/// <param name="column">Column coordinate of the test point. Default: 100.0</param>
		/// <returns>All contours or polygons containing the test point.</returns>
		// Token: 0x06001D06 RID: 7430 RVA: 0x000B3788 File Offset: 0x000B1988
		public new HXLDPoly SelectXldPoint(HTuple row, HTuple column)
		{
			IntPtr proc = HalconAPI.PreCall(1676);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, row);
			HalconAPI.Store(proc, 1, column);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Choose all contours or polygons containing a given point.
		///   Instance represents: Contours or polygons to be examined.
		/// </summary>
		/// <param name="row">Line coordinate of the test point. Default: 100.0</param>
		/// <param name="column">Column coordinate of the test point. Default: 100.0</param>
		/// <returns>All contours or polygons containing the test point.</returns>
		// Token: 0x06001D07 RID: 7431 RVA: 0x000B37EC File Offset: 0x000B19EC
		public new HXLDPoly SelectXldPoint(double row, double column)
		{
			IntPtr proc = HalconAPI.PreCall(1676);
			base.Store(proc, 1);
			HalconAPI.StoreD(proc, 0, row);
			HalconAPI.StoreD(proc, 1, column);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Select contours or polygons using shape features.
		///   Instance represents: Contours or polygons to be examined.
		/// </summary>
		/// <param name="features">Shape features to be checked. Default: "area"</param>
		/// <param name="operation">Operation type between the individual features. Default: "and"</param>
		/// <param name="min">Lower limits of the features or 'min'. Default: 150.0</param>
		/// <param name="max">Upper limits of the features or 'max'. Default: 99999.0</param>
		/// <returns>Contours or polygons fulfilling the condition(s).</returns>
		// Token: 0x06001D08 RID: 7432 RVA: 0x000B3844 File Offset: 0x000B1A44
		public new HXLDPoly SelectShapeXld(HTuple features, string operation, HTuple min, HTuple max)
		{
			IntPtr proc = HalconAPI.PreCall(1678);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, features);
			HalconAPI.StoreS(proc, 1, operation);
			HalconAPI.Store(proc, 2, min);
			HalconAPI.Store(proc, 3, max);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.UnpinTuple(min);
			HalconAPI.UnpinTuple(max);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Select contours or polygons using shape features.
		///   Instance represents: Contours or polygons to be examined.
		/// </summary>
		/// <param name="features">Shape features to be checked. Default: "area"</param>
		/// <param name="operation">Operation type between the individual features. Default: "and"</param>
		/// <param name="min">Lower limits of the features or 'min'. Default: 150.0</param>
		/// <param name="max">Upper limits of the features or 'max'. Default: 99999.0</param>
		/// <returns>Contours or polygons fulfilling the condition(s).</returns>
		// Token: 0x06001D09 RID: 7433 RVA: 0x000B38C0 File Offset: 0x000B1AC0
		public new HXLDPoly SelectShapeXld(string features, string operation, double min, double max)
		{
			IntPtr proc = HalconAPI.PreCall(1678);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, features);
			HalconAPI.StoreS(proc, 1, operation);
			HalconAPI.StoreD(proc, 2, min);
			HalconAPI.StoreD(proc, 3, max);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Transform the shape of contours or polygons.
		///   Instance represents: Contours or polygons to be transformed.
		/// </summary>
		/// <param name="type">Type of transformation. Default: "convex"</param>
		/// <returns>Transformed contours respectively polygons.</returns>
		// Token: 0x06001D0A RID: 7434 RVA: 0x000B392C File Offset: 0x000B1B2C
		public new HXLDPoly ShapeTransXld(string type)
		{
			IntPtr proc = HalconAPI.PreCall(1689);
			base.Store(proc, 1);
			HalconAPI.StoreS(proc, 0, type);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Insert objects into an iconic object tuple.
		///   Instance represents: Input object tuple.
		/// </summary>
		/// <param name="objectsInsert">Object tuple to insert.</param>
		/// <param name="index">Index to insert objects.</param>
		/// <returns>Extended object tuple.</returns>
		// Token: 0x06001D0B RID: 7435 RVA: 0x000B397C File Offset: 0x000B1B7C
		public HXLDPoly InsertObj(HXLDPoly objectsInsert, int index)
		{
			IntPtr proc = HalconAPI.PreCall(2121);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsInsert);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsInsert);
			return result;
		}

		/// <summary>
		///   Remove objects from an iconic object tuple.
		///   Instance represents: Input object tuple.
		/// </summary>
		/// <param name="index">Indices of the objects to be removed.</param>
		/// <returns>Remaining object tuple.</returns>
		// Token: 0x06001D0C RID: 7436 RVA: 0x000B39DC File Offset: 0x000B1BDC
		public new HXLDPoly RemoveObj(HTuple index)
		{
			IntPtr proc = HalconAPI.PreCall(2124);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(index);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Remove objects from an iconic object tuple.
		///   Instance represents: Input object tuple.
		/// </summary>
		/// <param name="index">Indices of the objects to be removed.</param>
		/// <returns>Remaining object tuple.</returns>
		// Token: 0x06001D0D RID: 7437 RVA: 0x000B3A34 File Offset: 0x000B1C34
		public new HXLDPoly RemoveObj(int index)
		{
			IntPtr proc = HalconAPI.PreCall(2124);
			base.Store(proc, 1);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Replaces one or more elements of an iconic object tuple.
		///   Instance represents: Iconic Input Object.
		/// </summary>
		/// <param name="objectsReplace">Element(s) to replace.</param>
		/// <param name="index">Index/Indices of elements to be replaced.</param>
		/// <returns>Tuple with replaced elements.</returns>
		// Token: 0x06001D0E RID: 7438 RVA: 0x000B3A84 File Offset: 0x000B1C84
		public HXLDPoly ReplaceObj(HXLDPoly objectsReplace, HTuple index)
		{
			IntPtr proc = HalconAPI.PreCall(2125);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsReplace);
			HalconAPI.Store(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(index);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsReplace);
			return result;
		}

		/// <summary>
		///   Replaces one or more elements of an iconic object tuple.
		///   Instance represents: Iconic Input Object.
		/// </summary>
		/// <param name="objectsReplace">Element(s) to replace.</param>
		/// <param name="index">Index/Indices of elements to be replaced.</param>
		/// <returns>Tuple with replaced elements.</returns>
		// Token: 0x06001D0F RID: 7439 RVA: 0x000B3AE8 File Offset: 0x000B1CE8
		public HXLDPoly ReplaceObj(HXLDPoly objectsReplace, int index)
		{
			IntPtr proc = HalconAPI.PreCall(2125);
			base.Store(proc, 1);
			HalconAPI.Store(proc, 2, objectsReplace);
			HalconAPI.StoreI(proc, 0, index);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HXLDPoly result;
			num = HXLDPoly.LoadNew(proc, 1, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(objectsReplace);
			return result;
		}
	}
}
